package team.sun.sss.dao.staff;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import team.sun.sss.pojo.staff.StaffThesis;

import java.util.List;

@Mapper
@Repository
public interface StaffThesisDao {

    @Select("select * from staff_thesis")
    List<StaffThesis> getStaffThesis();

    @Select("select * from staff_thesis where sta_num=#{staNum}")
    List<StaffThesis> getStaffThesisById(String staNum);

    @Delete("delete from staff_thesis where thesis_id=#{thesisId}")
    int deleteStaffThesis(int thesisId);

    @Insert("insert into staff_thesis(thesis_name,thesis_for_publication,thesis_time,sta_num) values(#{thesisName},#{thesisForPublication},#{thesisTime},#{staNum})")
    int addStaffThesis(StaffThesis staffThesis);

    @Update("update staff_thesis set thesis_name=#{thesisName},thesis_for_publication=#{thesisForPublication},thesis_time=#{thesisTime},sta_num=#{staNum} where thesis_id=#{thesisId}")
    int updateStaffThesis(StaffThesis staffThesis);
}
